/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;

import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.CounterBase;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.templates.commands.*;

/**
 *
 * @author jdmarler
 */


public class ShifterGearbox {

    Talon topMotor;
    Talon bottomMotor;
    Solenoid openSolenoid;
    Solenoid closeSolenoid;

    public ShifterGearbox(int topMotorPort, int bottomMotorPort, int openSolenoidPort, int closeSolenoidPort) {
         
       try {
           topMotor = new Talon(topMotorPort);
           bottomMotor = new Talon(bottomMotorPort);
           topMotor.setSafetyEnabled(false);
           bottomMotor.setSafetyEnabled(false);
           openSolenoid = new Solenoid(openSolenoidPort);
           closeSolenoid = new Solenoid(closeSolenoidPort);
       }

       catch (Exception e){
           e.printStackTrace();
        }  
   }
  
    // Put methods for controlling this subsystem
    // here. Call these from Commands.
    
    public void setSpeed(double s){
        topMotor.set(s);
        bottomMotor.set(s);
    }
    
    public void highGear(){
        openSolenoid.set(true);
        closeSolenoid.set(false);
    }
        
    public void lowGear(){
        openSolenoid.set(false);
        closeSolenoid.set(true);
        
    }
    
    public SpeedController getTopMotor() {
        return topMotor;
    }

    public SpeedController getBottomMotor() {
        return bottomMotor;
    }   
}
